package com.hwpt.controller.user;

import com.hwpt.dto.user.FeedbackDTO;
import com.hwpt.result.Result;
import com.hwpt.service.FeedBackService;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/user/feedback") // 正确：通过@RequestMapping定义API路径
@Slf4j
@RequiredArgsConstructor
@Tag(name = "用户反馈接口")
@Controller("userFeedBackController")
public class FeedBackController {

    private final FeedBackService feedBackService;

    @PostMapping("/submitFeedback")
    @ApiOperation("用户反馈")
    public Result<List<String>> feedback(@RequestBody FeedbackDTO feedbackDTO) {
        log.info("用户反馈：{}", feedbackDTO.toString());
        List<String> imageUrls = feedBackService.saveFeedBack(feedbackDTO);
        return Result.success(imageUrls);
    }



}

